//
//  TradingRecordCell.m
//  NtoccShipper
//
//  Created by mac on 2019/11/11.
//  Copyright © 2019 zhuchongjin. All rights reserved.
//

#import "TradingRecordCell.h"
@interface TradingRecordCell()
@property (strong, nonatomic) CJLabel *labTitleType;
@property (strong, nonatomic) CJLabel *labTime;

@property (strong, nonatomic) CJView *viewSecond;
@property (strong, nonatomic) CJLabel *labOrderText;
@property (strong, nonatomic) CJLabel *labOrderNum;

@property (strong, nonatomic) CJLabel *labMoney;
@property (strong, nonatomic) CJLabel *labMoneyRecord;

@end

@implementation TradingRecordCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)sewtCellInfoWithModel:(TradingRecordModel *)model{
    
    if (model) {
//
//        // 消费项目(0-充值，1-保证金 2-运费 3-保费 4-罚款 5-提现 6-信息费)
//        
//        switch (model.paidItem.integerValue) {
//            case 0:
//                self.labTitleType.text = @"充值";
//                break;
//            case 1:
//              self.labTitleType.text = @"保证金";
//              break;
//            case 2:
//                  self.labTitleType.text = @"运费";
//                  break;
//            case 3:
//                  self.labTitleType.text = @"保费";
//                  break;
//            case 4:
//                  self.labTitleType.text = @"罚款";
//                  break;
//            case 5:
//                  self.labTitleType.text = @"提现";
//                  break;
//            case 6:
//                  self.labTitleType.text = @"信息费";
//                  break;
//            default:
//                break;
//        }
        self.labTitleType.text = model.paidItemName;
//        // 充值提现
        self.labTime.text = model.gmtCreated;

//        if (model.paidItem.integerValue == 0 || model.paidItem.integerValue == 5) {
//            self.viewSecond.hidden = YES;
//        }else{
//            self.viewSecond.hidden = NO;
//            self.labOrderNum.text = model.orderDetailNumber;
//        }

        if (IsNilOrNull(model.orderDetailNumber) || [model.orderDetailNumber isEqualToString:@""]) {
            self.viewSecond.hidden = YES;
        }else{
            self.viewSecond.hidden = NO;
            self.labOrderNum.text = model.orderDetailNumber;
        }

        self.labMoney.text = CJStringWithFormat(@"余额:%@",@(model.accountAmount).cj_money_description);
        // 0 收入  paidFeeType=1支出金额显示为负的，paidFeeType=0收入显示为正的  建任务

        if (model.paidFeeType.integerValue == 0) {
            self.labMoneyRecord.textColor = [UIColor cjMainColorText];
            self.labMoneyRecord.text = CJStringWithFormat(@"%@",@(model.paidAmount).cj_money_description);
        }else{
            self.labMoneyRecord.textColor = [UIColor cjRedColor];
            self.labMoneyRecord.text = CJStringWithFormat(@"-%@",@(model.paidAmount).cj_money_description);
        }
        
    }
}

@end
